import request  from "../request.js"

const Api = {
    page: '/admin/product-message/page?',
    delete: '/admin/product-message/delete/id=',
    editOrSave: '/admin/product-message/update',
    batch: '/admin/product-message/batchd_delete'
}


/**
 * 分页获取商品评价信息
 * @param id int 用户提交id
 * @return {AxiosPromise}
 */
export function getPageProductMessage(param){
    return request({
        url: Api.page,
        method: 'GET',
        params: param
    })
}

/**
 * 根据id删除商品评价信息
 * @param id int 用户提交id
 * @return {AxiosPromise}
 */
export function deleteProductMessageById(id) {
    return request({
        url: Api.delete + id,
        method: 'GET'
    })
}

/**
 * 批量删除商品评价信息
 * @ids  array id数组
 * @return {AxiosPromise}
 */
export function batchDeleteProductMessageInfo(ids){
    return request({
        url: Api.batch,
        method: 'post',
        data: ids
    })
}

/**
 * 修改或保存商品评价信息
 * @productinfo  object 商品信息
 * @return {AxiosPromise}
 */
export function editOrSaveProductMessageInfo(productinfo){
    return request({
        url: Api.editOrSave,
        method: 'post',
        data: productinfo
    })
}